<template>
	<page-body>
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center result_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub result_fd0_0'>
					<view class='flex flex-wrap align-center result_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
						data-url="1">
						<text class='fu-iconfont2  result_fd0_0_c0_c0'>&#xE794;</text>
					</view>
					<view class='flex flex-wrap align-stretch justify-center'>
						<text class='result_fd0_0_c1_c0'>结果</text>
					</view>
					<view class='flex flex-wrap align-center justify-end result_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout result_flex_1">
				<view class='flex flex-direction flex-wrap align-center self-center justify-center result_fd1_0'>
					<view class='flex flex-wrap align-center'>
						<text class='result_fd1_0_c0_c0'>{{list.total.score}}</text>
						<text class='result_fd1_0_c0_c1'>分</text>
					</view>
					<view class="">
						考试时长{{use_time}}
					</view>
					<view class='flex flex-wrap align-center'>
						<text class='result_fd1_0_c1_c0'>本次得分</text>
					</view>
					<view class='flex flex-wrap align-center result_fd1_0_c2'>
						<text>您答对</text>
						<text>{{list.total.correct_num}}</text>
						<text>道题</text>
					</view>
				</view>
				<view class='flex flex-direction flex-wrap align-stretch'>
					<view class='flex flex-wrap align-center'>
						<text class='result_fd1_1_c0_c0'>考试分析</text>
					</view>
					<view class='flex flex-wrap align-center justify-between'>
						<view class='flex flex-direction flex-wrap align-stretch justify-between result_fd1_1_c1_c0'>
							<view class='flex flex-wrap align-center'>
								<text class='result_fd1_1_c1_c0_c0_c0'>单选</text>
							</view>
							<view class='flex flex-wrap align-center'>
								<text>题数：</text>
								<text class='result_fd1_1_c1_c0_c1_c1'>{{list.dan.danxuan}}</text>
							</view>
							<view class='flex flex-wrap align-center'>
								<text>错误数：</text>
								<text class='result_fd1_1_c1_c0_c2_c1'>{{list.dan.dan_wrong}}</text>
							</view>
							<view class='flex flex-wrap align-center'>
								<text>正确率：</text>
								<text class='result_fd1_1_c1_c0_c3_c1'>{{list.dan.right}}</text>
								<text class='result_fd1_1_c1_c0_c3_c1'>%</text>
							</view>
						</view>
						<view class='flex flex-direction flex-wrap align-stretch justify-between result_fd1_1_c1_c0'>
							<view class='flex flex-wrap align-center'>
								<text class='result_fd1_1_c1_c0_c0_c0'>多选</text>
							</view>
							<view class='flex flex-wrap align-center'>
								<text>题数：</text>
								<text class='result_fd1_1_c1_c0_c1_c1'>{{list.duo.duoxuan}}</text>
							</view>
							<view class='flex flex-wrap align-center'>
								<text>错误数：</text>
								<text class='result_fd1_1_c1_c0_c2_c1'>{{list.duo.duo_wrong}}</text>
							</view>
							<view class='flex flex-wrap align-center'>
								<text>正确率：</text>
								<text class='result_fd1_1_c1_c0_c3_c1'>{{list.duo.duo_right}}</text>
								<text class='result_fd1_1_c1_c0_c3_c1'>%</text>
							</view>
						</view>
						<view class='flex flex-direction flex-wrap align-stretch justify-between result_fd1_1_c1_c0'>
							<view class='flex flex-wrap align-center'>
								<text class='result_fd1_1_c1_c0_c0_c0'>判断</text>
							</view>
							<view class='flex flex-wrap align-center'>
								<text>题数：</text>
								<text class='result_fd1_1_c1_c0_c1_c1'>{{list.pan.panduan}}</text>
							</view>
							<view class='flex flex-wrap align-center'>
								<text>错误数：</text>
								<text class='result_fd1_1_c1_c0_c2_c1'>{{list.pan.pan_wrong}}</text>
							</view>
							<view class='flex flex-wrap align-center'>
								<text>正确率：</text>
								<text class='result_fd1_1_c1_c0_c3_c1'>{{list.pan.pan_right}}</text>
								<text class='result_fd1_1_c1_c0_c3_c1'>%</text>
							</view>
						</view>
					</view>
				</view>
			</view>

			<!---flex布局flex布局结束-->
			<view class="flex flex-wrap align-start justify-around benben-position-layout flex result_flex_2"
				:style="{height:(130+bottomSafeAreaRpx)+'rpx',paddingBottom:bottomSafeAreaRpx+'rpx', }">
				<button class='result_fd2_0' @tap.stop="ckct">查看错题</button>
				<button class='result_fd2_1' @tap.stop="seeAnswal">查看解析</button>
			</view>
			<view :style="{height: (130+bottomSafeAreaRpx)+'rpx'}"></view>
		</view>
	</page-body>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},


		data() {
			return {
				"list": {
					"total": {
						"aid": "",
						"score": "",
						"correct_num": ""
					},
					"dan": {
						"danxuan": "",
						"dan_wrong": "",
						"right": ""
					},
					"duo": {
						"duoxuan": "",
						"duo_wrong": "",
						"duo_right": ""
					},
					"pan": {
						"panduan": "",
						"pan_wrong": "",
						"pan_right": ""
					}
				},
				"examlog_id": "49",
				use_time:'',//考试时长
			};
		},
		computed: {
			userInfo: {
				get() {
					return this.$store.state.userInfo
				},
				set() {
					this.$store.commit('updateUserInfo', value)
				},
			}
		},
		watch: {},
		onLoad(options) {
			let {
				examlog_id
			} = options
			if (examlog_id !== undefined) this.examlog_id = examlog_id
			this.getyg4b50fc705845Func()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			ckct() {
				if (this.list.duo.duo_wrong == 0 && this.list.dan.dan_wrong == 0 && this.list.pan.pan_wrong == 0) {
					this.$message.info('无错题')
				} else {
					uni.navigateTo({
						url: '/pageschool/school/answer/answer?type=3&course_id=' + this.examlog_id
					})
				}

			},
			// 查看解析
			seeAnswal() {
				let aid = '';
				// if (this.type == 1) {
				// 	aid = this.total.aid;
				// } else {
				// 	aid = this.aid
				// }
				aid = this.list.total.aid
				uni.redirectTo({
					url: '/pageschool/school/trueOrFalseQuestions/trueOrFalseQuestions?aid=' + aid
				})
			},
			//获取考试结果
			async getyg4b50fc705845Func() {
				//请求方法
				//数据验证

				let datalist = await this.$api.post(global.apiUrls.post64b50fc705845, {
					examlog_id: this.examlog_id
				});

				if (datalist.data.code != 1) {
					// this.$message.info(datalist.data.msg);
					return
				}
				let infolist = datalist.data;
				this.list = infolist.data
				console.log("aid=>", this.list)
				this.use_time=this.list.total.use_time
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #fff;
		background-size: 100% auto;
	}

	.result_flex_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.result_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 700;
		color: #333333;
		line-height: 50rpx;
	}

	.result_fd0_0_c0_c0 {
		font-size: 36rpx;
		color: #333;
	}

	.result_fd0_0_c0 {
		width: 120rpx;
	}

	.result_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.result_flex_1 {
		padding: 58rpx 32rpx 40rpx 032rpx;
	}

	.result_fd1_1_c1_c0_c3_c1 {
		font-size: 36rpx;
		font-weight: 700;
		color: rgba(42, 42, 42, 1);
	}

	.result_fd1_1_c1_c0_c2_c1 {
		font-size: 36rpx;
		font-weight: 700;
		color: rgba(226, 83, 81, 1);
	}

	.result_fd1_1_c1_c0_c1_c1 {
		font-size: 36rpx;
		color: rgba(42, 42, 42, 1);
		font-weight: 700;
	}

	.result_fd1_1_c1_c0_c0_c0 {
		color: rgba(51, 51, 51, 1);
		font-weight: 500;
	}

	.result_fd1_1_c1_c0 {
		background: rgba(247, 247, 248, 1);
		width: 324rpx;
		height: 278rpx;
		padding: 24rpx 32rpx 18rpx 32rpx;
		color: rgba(102, 102, 102, 1);
		font-size: 26rpx;
		line-height: 37rpx;
		border-radius: 16rpx;
		background-size: 100% auto;
		margin: 0rpx 0rpx 16rpx 0rpx;
	}

	.result_fd1_1_c0_c0 {
		font-size: 32rpx;
		line-height: 45rpx;
		font-weight: 500;
		margin: 0rpx 0rpx 20rpx 0rpx;
	}

	.result_fd1_0_c2 {
		color: rgba(178, 178, 178, 1);
		font-size: 26rpx;
		line-height: 37rpx;
	}

	.result_fd1_0_c1_c0 {
		margin: 22rpx 0rpx 18rpx 0rpx;
		font-size: 30rpx;
		font-weight: 700;
	}

	.result_fd1_0_c0_c1 {
		margin: 0rpx 0rpx 0rpx 26rpx;
	}

	.result_fd1_0_c0_c0 {
		color: rgba(204, 34, 28, 1);
		font-size: 80rpx;
		font-weight: 700;
		line-height: 80rpx;
	}

	.result_fd1_0 {
		margin: 0rpx 0rpx 32rpx 0rpx;
		color: rgba(42, 42, 42, 1);
	}

	.result_flex_2 {
		background: rgba(255, 255, 255, 1);
		width: 750rpx;
		height: 130rpx;
		overflow: hidden;
		z-index: 999999;
		bottom: calc(0rpx + var(--window-bottom));
		background-size: 100% auto;
	}

	.result_fd2_1 {
		background: rgba(204, 34, 28, 1);
		border-radius: 45rpx;
		width: 320rpx;
		line-height: 88rpx;
		font-size: 32rpx;
		color: var(--benbenFontColor3);
		height: 88rpx;
	}

	.result_fd2_0 {
		border: 1px solid rgba(238, 238, 238, 1);
		background: #fff;
		border-radius: 45rpx;
		width: 320rpx;
		line-height: 88rpx;
		font-size: 32rpx;
		color: rgba(51, 51, 51, 1);
		height: 88rpx;
	}
</style>
